﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CollegeWebsite.Models.Student>" %>
<div id="LoginAjaxContent">
    <div class="art-block">
        <div class="art-block-tl">
        </div>
        <div class="art-block-tr">
        </div>
        <div class="art-block-bl">
        </div>
        <div class="art-block-br">
        </div>
        <div class="art-block-tc">
        </div>
        <div class="art-block-bc">
        </div>
        <div class="art-block-cl">
        </div>
        <div class="art-block-cr">
        </div>
        <div class="art-block-cc">
        </div>
        <div class="art-block-body">
            <div class="art-blockheader">
                <div class="l">
                </div>
                <div class="r">
                </div>
                <h3 class="t">
                    Student Login</h3>
            </div>
            <div class="art-blockcontent">
                <div class="art-blockcontent-body">
                    <% using (Html.BeginForm("Login", "Student"))
                       {%>
                    <%= Html.ValidationSummary(true) %>
                    <div class="editor-label">
                        <%= Html.LabelFor(model => model.Email) %>
                    </div>
                    <div class="editor-field">
                        <%= Html.TextBoxFor(model => model.Email) %>
                        <%= Html.ValidationMessageFor(model => model.Email) %>
                    </div>
                    <div class="editor-label">
                        <%= Html.LabelFor(model => model.Password) %>
                    </div>
                    <div class="editor-field">
                        <%= Html.PasswordFor(model => model.Password) %>
                        <%= Html.ValidationMessageFor(model => model.Password) %>
                    </div>
                    <div>
                    <div class="loadbar"></div>
                    <input type="button" value="Login" id="LoginNow" />
                    </div>
                    <% } %>
                    
                    <div class="cleared">
                    </div>
                </div>
            </div>
        </div>
        <div class="cleared">
        </div>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $("#LoginNow").click(function() {
            $('#LoginAjaxContent .loadbar').show();
            $.ajax({
                type: 'POST',
                url: '<%= Url.Action("Login","Student") %>',
                data: $('#LoginAjaxContent form').serialize(),
                success: function(data) {
                    $('#LoginAjaxContent').html(data);
                    $('#LoginAjaxContent .art-blockcontent-body').effect('pulsate');

                }
            });





        });
    })

</script>

